import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue'
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import { axios } from '@/utils/request'
import { apiUrl } from '@/api/api.js'

/**
 * 公共API接口
 */
 export const api = {
  thirdLoginRenderType: (source) => apiUrl.domianUrl(`/sys/thirdLogin/render/${source}`)
}

/**
 * 第三方登录
 * @param token
 * @param thirdType
 * @returns {*}
 */
 export const thirdLogin = (token, thirdType) => {
  return axios({
    url: `/sys/thirdLogin/getLoginUser/${token}/${thirdType}`,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 绑定第三方手机号
 * @param {*} params
 * @returns
 */
export const bindingThirdPhone = (params) => postAction('/sys/thirdLogin/bindingThirdPhone', params)

/**
 * 创建新账号
 * @param {*} params
 * @returns
 */
export const thirdCreateUser = params => postAction('/sys/third/user/create', params);

/**
 * 验证密码
 * @param {*} params
 * @returns
 */
export const thirdCheckPassword = params => postAction('/sys/third/user/checkPassword', params);
